package com.ym.medical.domain.param;

import com.ym.common.constant.BeanCovert;
import com.ym.medical.domain.entity.SysCodeRuleEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import static com.ym.common.constant.ValidRule.Add;
import static com.ym.common.constant.ValidRule.Update;

/**
 * 编码生产对象 sys_code_rule
 *
 * @author ym
 * @date 2020-08-17
 */
@ApiModel("编码生产-修改")
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysCodeRuleUpdateParam extends BeanCovert<SysCodeRuleEntity>{

    @ApiModelProperty("主键")
    @NotNull(message = "主键不能为空", groups = {Add.class, Update.class})
    private Long id;

    @ApiModelProperty("规则名称")
    @Size(max = 64, message = "规则名称长度超过{max}", groups = {Add.class, Update.class})
    private String ruleName;

    @ApiModelProperty("规则编码")
    @Size(max = 32, message = "规则编码长度超过{max}", groups = {Add.class, Update.class})
    private String ruleCode;

    @ApiModelProperty("编码前缀")
    @Size(max = 64, message = "编码前缀长度超过{max}", groups = {Add.class, Update.class})
    private String codePrefix;

    @ApiModelProperty("序列长度")
    private Integer serialLength;

    @ApiModelProperty("索引值")
    private Long serial;

    @ApiModelProperty("日期格式化")
    @Size(max = 64, message = "日期格式化长度超过{max}", groups = {Add.class, Update.class})
    private String curFormatVal;

    @ApiModelProperty("日期格式化格式,如yyyyMM")
    @Size(max = 64, message = "日期格式化格式,如yyyyMM长度超过{max}", groups = {Add.class, Update.class})
    private String format;

    @ApiModelProperty("格式类型,1日期+序列。2日期+时间戳+随机数")
    @Size(max = 64, message = "格式类型,1日期+序列。2日期+时间戳+随机数长度超过{max}", groups = {Add.class, Update.class})
    private String formatType;


}
